<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>网站配置</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="/favicon.ico">
    <link href="/static/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/static/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <!-- Data Tables -->
    <link href="/static/admin/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">


    <link href="/static/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/static/admin/css/animate.css" rel="stylesheet">
    <link href="/static/admin/css/style.css?v=4.1.0" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>网站配置</h5>
                </div>
                <div class="ibox-content">
                <div class="tabs-container">
                    <ul class="nav nav-tabs" id="myTab11">
                        {foreach $config_groups as $key => $group}
                        <li class="{if $key eq 0}active{/if}">
                            <a data-toggle="tab" data-id="{$group.id}" onclick="getConfigData(obj)"
                               href="#{$group.group_name}">
                                {$group.group_title}
                            </a>
                        </li>
                        {/foreach}
                    </ul>
                    <div class="tab-content">
                        {foreach $config_groups as $key => $group}
                        <div id="{$group.group_name}" class="tab-pane {if $key eq 0}in active{/if}">
                            <form action="{:url('Config/webConfig')}" method="post" class="form-horizontal">
                                {foreach $group['configs'] as $key => $v}
                                <div class="form-group">
                                    <label class="col-sm-2 control-label no-padding-right">{$v['config_desc']}:</label>
                                    <div class="col-sm-6">
                                        {switch $v['config_type']}
                                        {case text}
                                        <input type="text" name="config[{$v.id}][config_value]"
                                               value="{$v['config_value']}" class="form-control">
                                        {/case}
                                        {case radio}
                                        <div class="radio">
                                            {foreach $v['config_info'] as $k1 => $v1}
                                            <label class="radio-inline i-checks">
                                                <input name="config[{$v.id}][config_value]" type="radio"
                                                       value="{$v1['0']}" {if condition="$v['config_value'] eq $v1['0']" }checked{/if}>
                                                <span class="text"> {$v1['1']}</span>
                                            </label>
                                            {/foreach}
                                        </div>
                                        {/case}
                                        {case select}
                                        <select name="config[{$v.id}][config_value]" class="form-control">
                                            {foreach $v['config_info'] as $k1 => $v1}
                                            <option value="{$v1['0']}" {if condition="$v['config_value'] eq $v1['0']" }selected{/if}>{$v1['1']}</option>
                                            {/foreach}
                                        </select>
                                        {/case}
                                        {case textarea}
                                        <textarea type="text" name="config[{$v.id}][config_value]"
                                                  class="form-control">{$v['config_value']}</textarea>
                                        {/case}
                                        {/switch}
                                    </div>
                                </div>
                                {/foreach}
                                <div class="form-group">
                                    <div class="col-sm-offset-2 col-sm-10">
                                        <button type="submit" id="" class="btn btn-primary">确定</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                        {/foreach}
                    </div>
                </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
</div>

<!-- 全局js -->
<script src="/static/admin/js/jquery.min.js?v=2.1.4"></script>
<script src="/static/admin/js/bootstrap.min.js?v=3.3.6"></script>

<!-- 自定义js -->
<script src="/static/admin/js/content.js?v=1.0.0"></script>

<!-- iCheck -->
<script src="/static/admin/js/plugins/iCheck/icheck.min.js"></script>

<!-- Page-Level Scripts -->
<script>
    $(document).ready(function () {
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });
    });
</script>

</body>

</html>
